
<?php
	session_start();
	include "db_function.php";
	$uid = intval($_SESSION['uid']);
	if($uid < 1){
		header("location: login.php");
		die;
	}elseif(isset($_POST['sub'])){
			$cmt_arr=array(
				"content"=>$_POST['content'],
				"uid"=>$_SESSION['uid'],
				"pid"=>$_GET['pid']
			);
			print_r($cmt_arr);
			creat_comment($cmt_arr);

  			header("location:post.php?pid={$_GET['pid']}");
	}
?>
